﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DirectMeterial.aspx.cs" Inherits="Hisun.View.Meterial.DirectMeterial" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
    <script language="javascript" for="document" event="onkeydown">

  if(event.keyCode==13 && event.srcElement.type!="button" && event.srcElement.type!="submit" && event.srcElement.type!="reset" && event.srcElement.type!="textarea" && event.srcElement.type!="")
{
      event.keyCode=9;
   }

</script> 
    <style type="text/css">
        .style2
        {
        }
        .style9
        {
            height: 7px;
        }
        .style11
        {
            height: 14px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div class =" CommonPage_MainPanel">
    <div class ="CommonPage_Banner"><div class = "CommomPage_Title">生产原辅料盘存</div></div>
    <div class ="CommonPage_Body">

    
        <table >
            <tr>
                <td class="style9">
                    <asp:Label ID="Label2" runat="server" Text="作业中心：" SkinID="Label"></asp:Label>
                    <asp:DropDownList ID="dropCostCenterSelect" runat="server" AutoPostBack="True" 
                        Height="21px" Width="180px" SkinID="DropdownList">
                    </asp:DropDownList>
                    <asp:Label ID="Label1" runat="server" Text="作业中心产品：" SkinID="Label"></asp:Label>
                    <asp:DropDownList ID="DropDownListSelectProductInProccess" runat="server" 
                        AutoPostBack="True" DataSourceID="LinqDataSource_ProductInProcess" 
                        DataTextField="中间体名称" DataValueField="中间体ID" Height="21px" Width="180px" 
                        SkinID="DropdownList">
                    </asp:DropDownList>
                    <asp:Button SkinID = "Button" ID="Button_Query" runat="server" onclick="Button_Query_Click" 
                        Text="查询" />
                    <asp:Button SkinID = "Button" ID="Button_AddMeterial" runat="server" 
                        onclick="Button_AddMeterial_Click" Text="增加" Enabled="False" />
                </td>
            </tr>
            <tr>
                <td class="style2">
                    <asp:GridView ID="GridView_Meterial" runat="server" SkinID = "GridView"  AutoGenerateColumns="False" 
                        DataKeyNames="ID">
                        <Columns>
                            <asp:BoundField DataField="ID" HeaderText="ID" ReadOnly="True" 
                                SortExpression="ID" Visible="False" />
                            <asp:BoundField DataField="材料ID" HeaderText="材料ID" ReadOnly="True" 
                                SortExpression="材料ID" />
                            <asp:BoundField DataField="材料名称" HeaderText="材料名称" />
                            <asp:BoundField DataField="计量单位" HeaderText="计量单位" ReadOnly="True" 
                                SortExpression="计量单位" />
                            <asp:BoundField DataField="期初数量" HeaderText="期初数量" ReadOnly="True" 
                                SortExpression="期初数量" DataFormatString="{0:F4}" />
                            <asp:BoundField DataField="领用数量" HeaderText="领用数量" ReadOnly="True" 
                                SortExpression="领用数量" DataFormatString="{0:F4}" />
                            <asp:BoundField DataField="本期耗用" HeaderText="本期耗用" ReadOnly="True" 
                                SortExpression="本期耗用" DataFormatString="{0:F4}" />
                            <asp:TemplateField HeaderText="期末数量" SortExpression="期末数量">
                                <EditItemTemplate>
                                    <asp:Label ID="Label1" runat="server" Text='<%# Eval("期末数量") %>'></asp:Label>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:TextBox ID="TextBox_FinalValue" runat="server" 
                                        Text='<%# string.Format("{0:F4}",Eval("期末数量")) %>'></asp:TextBox>
                                    <asp:CompareValidator ID="CompareValidator1" runat="server" 
                                        ControlToValidate="TextBox_FinalValue" ErrorMessage="*" 
                                        Operator="DataTypeCheck" Type="Double" ValidationGroup="Group"></asp:CompareValidator>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    <asp:Button SkinID = "Button" ID="Button_Save_1" runat="server" Text="保存" 
                        ValidationGroup="Save" onclick="Button_Save_Click" Visible="False" />
                    <asp:LinqDataSource ID="LinqDataSource_ProductInProcess" runat="server" 
                        ContextTypeName="Hisun.Models.HisunDBDataContext" Select="new (中间体ID, 中间体名称)" 
                        TableName="TABC_JS_ProductInProcess" 
                        Where="作业中心ID == @作业中心ID &amp;&amp; 可用 == @可用">
                        <WhereParameters>
                            <asp:ControlParameter ControlID="dropCostCenterSelect" Name="作业中心ID" 
                                PropertyName="SelectedValue" Type="Int32" />
                            <asp:Parameter DefaultValue="True" Name="可用" Type="Boolean" />
                        </WhereParameters>
                    </asp:LinqDataSource>
                    <asp:HiddenField ID="HiddenField_CenterId" runat="server" />
                    <asp:HiddenField ID="HiddenField_PIPId" runat="server" />
                </td>
            </tr>
        </table>
    
    </div></div>
    </form>
</body>
</html>
<% = alter %>